const db = require('../js_sdk/index.js')
module.exports = function() {
	let lib = db()
	let hassystem = lib.getdata('systems_data');
	console.log(hassystem)
	if (!hassystem) {
		// 清除所有数据
		db().setnull();

		// 存储的数据结构
		let structsJsoin = require('./struct.json')
		for (let p in structsJsoin) {
			lib.createTable(structsJsoin[p], p);
		}

		// 数据内容
		let coinseth = require('./coins_eth.json');
		console.log(coinseth)
		lib.insertJson('coins_eth', coinseth);


		let now = db().getnow();
		let sysdata = [{
			uuid: db().getuid(),
			createtime: now,
			ratetime: 5000,
			ratectime: 0,
			pricetime: 6000,
			pricectime: 0,
			defnode: "coincap"

		}];
		db('systems').insert(sysdata)
		return false;
	} else {
		return true;
	}
}